1. Field of the Invention
The technology disclosed herein relates to an image synthesis apparatus for synthesizing a foreground image with a background image. The foreground image is, for example, a 3D object image for which an anti-aliasing process is performed. The background image is, for example, a 2D image such as a natural image. The technology disclosed herein further relates to an electrical apparatus including the image synthesis apparatus, such as a portable game device; an image synthesis method using the image synthesis apparatus; a control program for making a computer to execute each step of the image synthesis method; and a computer-readable recording medium recorded thereon the control program.
2. Description of the Related Art
Conventionally, an image synthesizing process for synthesizing a foreground image (e.g. a 3D object image) with a background image (e.g. a 2D image such as a natural image) is known in a digital image processing technique. For example, the image synthesizing process is performed as follows.
A background image such as a scenery and a foreground image such as an image of a car are prepared. Then, a mask process is performed to separate a predetermined area from the foreground image. For example, in this mask process, only an area corresponding the car is cut out of the foreground image.
Next, in order to overlap the cut out area of the foreground image over the background image, a location of the cut out area within the background image is determined, a scaling ratio for the cut out area is determined, and the color of the cut out area is adjusted. Then, the foreground image is synthesized with the background image.
In this image synthesizing process, an anti-aliasing process is performed to reduce aliasing which causes the display of the outline portion of the foreground image like the steps and the creation of flicker-line. In the anti-aliasing process, the color information is blended (averaged) for each pixel (or each dot) of the foreground image.
For example, in the anti-aliasing process using the M*N super-sampling method, a foreground image data having a size of X*M dots along the horizontal direction and Y*N dots along the vertical direction is input, while a foreground image having a size of X dots along the horizontal direction and Y dots along the vertical direction is output. For each dot of the output image data, the M*N number of color information of the input image data is averaged (blended) and then the averaged (blended) color information is output. According to the M*N super-sampling method, it is possible to display the outline portion of the foreground image more beautifully by using a broader range of data.
Further, an alpha synthesizing process is performed to improve artificial appearance and/or discontinuation of the borderline portion between the background image and the foreground image.
In the alpha synthesizing process, an alpha value representing the weighting of the foreground image and the background image is set, for example, under the assumption that. a value of “1” is assigned for a pixel which is located inside the mask and a value of “0” is assigned for a pixel which is located outside the mask. Then, the color information of the background image and the color information of the foreground image are blended (averaged with weight) by the use of the alpha value.
Conventionally, in synthesizing the foreground image (e.g. a 3D object image) with the background image (e.g. a 2D image such as a natural image), one problem to be solved is how to determine a synthesizing ratio between the foreground image and the background image.
As a method for solving the problem above, for example, a method disclosed in Japanese laid-open patent publication No. 4-340671 is known. In this method, the alpha value is calculated depending on a shape of the mask in the vicinity of the outline portion of the foreground image, and then the foreground image and the background image are synthesized using the alpha value.
However, according to the method disclosed in Japanese laid-open patent publication No. 4-340671, re-calculation of the alpha value for each dot of the foreground image is required prior to the image synthesizing process. This causes a problem that the time required for the image synthesis is increased.
Further, the dot information around the outline portion of the foreground image is required to calculate the alpha value. This causes a problem that it is necessary to store information for previous several lines even if a drawing system is used for performing the process line by line.
The technology disclosed herein is intended to solve the conventional problems described above. One purpose of the technology disclosed herein is to provide an image synthesis apparatus capable of performing an image synthesizing process at a higher speed without re-calculating the alpha value in synthesizing the foreground image with the background image and capable of performing the image synthesizing process without changing configuration even if a drawing system is used for performing the process line by line. Another purpose of the technology disclosed herein is to provide an electrical apparatus including the image synthesis apparatus; an image synthesis method using the image synthesis apparatus; a control program for making a computer to execute each step of the image synthesis method; and a computer-readable recording medium recorded thereon the control program.